#include<bits/stdc++.h>
using namespace std;
int main()
{
     freopen("duel.in","r",stdin);
     freopen("duel.out","w",stdout);
     int n,a[10005],w=0;
     cin>>n;
     for(int i=1;i<=n;i++) cin>>a[i];
     sort(a,a+n+1);
     for(int i=n;i>=1;i--)
       if(a[i]==a[1])
        w++;
       cout<<n-w;
    return 0;
}
